package com.msb.singleton;

/**
 * @Auther： WangLei
 * @Date： 2021/8/1-08-01-23:15
 * @Description: com.msb.singleton
 * @version: 1.0
 */
public class BaseOfStatic {
    private BaseOfStatic(){}

    private static BaseOfStatic INSTANCE = null;

    static{
        System.out.println("loading...");
        INSTANCE = new BaseOfStatic();
    }

    public static BaseOfStatic getInstance()  {

        return INSTANCE;
    }

    public static void main(String[] args) {

        BaseOfStatic l1 = BaseOfStatic.getInstance();
        BaseOfStatic l2 = BaseOfStatic.getInstance();
        System.out.println(l1 == l2);
    }
}
